package com.hzit.sk.resp;

import lombok.Data;

/**
 * 返回前端的通用对象
 */
@Data
public class Response<T> {

    private int code;

    private String msg;

    private T data;


    public static Response getFailData(String msg){
        Response response = new Response();
        response.setCode(-1);
        response.setMsg(msg);
        return response;
    }

    public static Response getSuccessData(String msg){
        Response response = new Response();
        response.setCode(0);
        response.setMsg(msg);
        return response;
    }

}
